package com.campus.server.service;

import com.campus.common.vo.Admin;
import com.campus.server.dao.AdminAccountManagementDao;
import com.campus.server.dao.AdminDao;

import java.util.List;

public class AdminAccountManagementService {
    private AdminAccountManagementDao adminAccountManagementDao = new AdminAccountManagementDao();
    private AdminDao adminDao = new AdminDao();

    public List<Admin> listAdmins() {
        return adminAccountManagementDao.listAllAdmins();
    }

    public boolean addAdmin(Admin admin){return adminDao.isRegister(admin.getAdminId(), "123456",admin);}

    public boolean deleteAdmin(String adminId) {return adminAccountManagementDao.deleteAdmin(adminId);}

    public Admin getAdminById(String adminId) {return adminAccountManagementDao.getAdminById(adminId);}

    public List<Admin> searchAdmins(String adminId, String name) {return adminAccountManagementDao.searchAdmins(adminId);}

}
